// @ts-ignore
/* eslint-disable */
import { PageData, PageParams } from '@/common/page';
import { request } from '@umijs/max';

export async function getUserPage(
  data: PageParams,
  options?: { [key: string]: any },
) {
  return request<{
    data: PageData;
    msg?: string;
    code: number
    success?: boolean;
  }>('/account-service/api/v1/account/page', {
    method: 'post',
    data,
    ...(options || {}),
  });
}

export async function getSocialAccountPage(
  data: PageParams,
  options?: { [key: string]: any },
) {
  return request<{
    data: PageData;
    msg?: string;
    code: number
    success?: boolean;
  }>('/account-service/api/v1/social_account/social_page', {
    method: 'post',
    data,
    ...(options || {}),
  });
}

export async function getAccountPermission(
  params: {
    accountId?: any;
    [key: string]: any
  },
  options?: { [key: string]: any },
) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  }>('/account-service/api/v1/account/findRoleByAccountId', {
    params,
    ...(options || {}),
  });
}

export async function updateAccount(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  }>('/account-service/api/v1/account/update_info', {
    data,
    method: 'PUT',
    ...(options || {}),
  });
}

export async function registerAccount(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  }>('/account-service/api/v1/account/register', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}

export async function batchDelAccount(data: { idList: any[] }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/v1/account/batch_del', {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}


export async function updateAccountStatus(data: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/v1/account/update_status', {
    data,
    method: 'PUT',
    ...(options || {}),
  });
}


export async function addSocialAccount(data: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/v1/social_account/add_social', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}

export async function updateSocialAccount(data: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/v1/social_account/update_social', {
    data,
    method: 'PUT',
    ...(options || {}),
  });
}


export async function delSocialAccount(params: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/v1/social_account/del', {
    params,
    method: 'DELETE',
    ...(options || {}),
  });
}


export async function addRoleByAccountId(data: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/permit/v1/role/addRoleByAccountId', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}

export async function deleteRoleByAccountId(data: {  [key: string]: any  }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/account-service/api/permit/v1/role/deleteRoleByAccountId', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}
